
package com.android.generator.whatid;

public class CalendarImpl extends CalendarManager {

    private Handler mCalendarHandler;

    @Override
    public void getCalendar(int text, String name) {
        mCalendarHandler.obtainMessage(WHAT_GETCALENDAR, new Object[] {
                text, name
        }).sendToTarget();
    }

    @Override
    public void getCalendarTest(String id) {
        mCalendarHandler.obtainMessage(WHAT_GETCALENDARTEST, new Object[] {
            id
        }).sendToTarget();
    }

    private static final int WHAT_GETCALENDAR = 101;

    private static final int WHAT_GETCALENDARTEST = 102;

    private class Handler {
        public Handler obtainMessage(int what, Object obj) {
            return new Handler();
        }

        public void sendToTarget() {

        }

        public void handleMessage(Message msg) {
            int what = msg.what;
            switch (what) {
                case WHAT_GETCALENDAR:
                    Object[] getCalendar = (Object[]) msg.obj;
                    int text = (int) getCalendar[0];
                    String name = (String) getCalendar[1];
                    //TODO
                case WHAT_GETCALENDARTEST:
                    Object[] getCalendarTest = (Object[]) msg.obj;
                    name = (String) getCalendarTest[0];
                    //TODO
                default:
                    break;
            }
        }
    }

    public static class Message {
        public int what;

        public Object obj;
    }

}
